<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>

	<head>
		<meta charset="UTF-8">
		<title>失物招领后台管理</title>
		<script type="text/javascript" src="../js/jquery.js"></script>
		<script src="../js/jquery.min.js" type="text/javascript"></script>
		<link rel="stylesheet" href="../css/bootstrap.css" />
		<link rel="stylesheet" href="../css/bootstrap.min.css" />
		<link rel="stylesheet" href="../css/main.css" />
		<link rel="stylesheet" href="../css/admain.css" />
		<script type="text/javascript" src="../js/bootstrap.js"></script>
		<script type="text/javascript" src="../js/scrollspy.js"></script>
		<link href="../fonts/css/font-awesome.css" rel="stylesheet">

		<!-- Toastr style -->
		<link href="../css/toastr.min.css" rel="stylesheet">

		<link href="../css/animate.css" rel="stylesheet">
		<link href="../css/style.css" rel="stylesheet">
		<!--sweetalert-->
		<link rel="stylesheet" href="../css/sweetalert.css" />
	</head>

	<body>
		<div id="wrapper">
			<!--左侧导航栏-->
			<nav class="navbar-default navbar-static-side" role="navigation">
				<div class="sidebar-collapse">
					<ul class="nav metismenu" id="side-menu">
						<li>
							<a href="#"><i class="fa fa-th-large"></i> <span class="nav-label">发帖管理</span> <span class="fa arrow"></span></a>
							<ul class="nav nav-second-level collapse">
								<li>
									<a href="findingadmin.jsp">寻帖审核</a>
								</li>
								<li>
									<a href="main.jsp">失物审核</a>
								</li>
							</ul>
						</li>
						<li>
							<a href="#"><i class="fa fa-th-large"></i> <span class="nav-label">信息管理</span> <span class="fa arrow"></span></a>
							<ul class="nav nav-second-level collapse">
								<li>
									<a href="locationadmin.jsp">招领点管理</a>
								</li>
								<li>
									<a href="charts.jsp">图表展示</a>
								</li>
								
							</ul>
						</li>
						<li>
							<a href="#"><i class="fa fa-th-large"></i> <span class="nav-label">管理</span> <span class="fa arrow"></span></a>
							<ul class="nav nav-second-level collapse">
								<li>
									<a href="editor.jsp">发布公告</a>
								</li>
								<li>
									<a href="data.jsp">数据备份</a>
								</li>
							</ul>
						</li>
					</ul>

				</div>
			</nav>
			<!--
            	作者：1462859532@qq.com
            	时间：2017-03-29
            	描述：右侧导航栏
            -->
			<div id="page-wrapper" class="gray-bg">
				<div class="row border-bottom">
					<nav class="navbar navbar-static-top" role="navigation" style="margin-bottom: 0">
						<div class="navbar-header">
							<a class="navbar-minimalize minimalize-styl-2 btn btn-primary " href="#"><i class="fa fa-bars"></i> </a>
						</div>
						<ul class="nav navbar-top-links navbar-right">
							<li>
								<span class="m-r-sm text-muted welcome-message">欢迎来到系统管理员</span>
							</li>
							<li>
								<a href="login.jsp">
									<i class="fa fa-sign-out"></i> 注销
								</a>
							</li>
						</ul>
					</nav>
				</div>
				<div class="row wrapper border-bottom white-bg page-heading">
					<div class="col-lg-10">
						<ol class="breadcrumb">
							<li>
								<a>信息管理</a>
							</li>
							<li class="active">
								<strong>失物信息</strong>
							</li>
						</ol>
					</div>
					<div class="col-lg-2">

					</div>
				</div>

				<div class="wrapper wrapper-content  animated fadeInRight article">
					
					<div class="row">

						<!--失物信息-->
						<div class="col-md-12">
						
						   <div>
						   	  <div class="pull-left">
						   	  	<select class="form-control" id="categotyappend">
									<option value="0">--请选择你的物品类型--</option>
								</select>
						   	  </div>
						   	<div class="pull-right">
									<div class="input-group"><input placeholder="按描述查找" class="input-sm form-control" type="text" id="querybydesc"> <span class="input-group-btn">
                                        <button type="button" class="btn btn-sm btn-primary" id="query"> 查询</button> </span>
									</div>
								</div>
								<div class="pull-right">
									<select class="form-control" id="isdeal">
										<option value="0">--请选择是否处理--</option>
										<option value="1">已同意</option>
										<option value="2">已驳回</option>
									</select>
								</div> 
								
							<br />

							<div class="losingadmin panel panel-default">
								<div class="panel-body">
									<table class="losingtable table table-striped" cellpadding="20px" cellspacing="5" id="losingshow">
										<thead>
											<tr class="active">
												<th style="width:20%">类型</th>
												<th style="width:20%">地点</th>
												<th style="width:20%">发布时间</th>
												<th style="width:20%">描述</th>
												<th style="width:20%">操作</th>
											</tr>
										</thead>
										<tbody id="losingitem">
											
										</tbody>
									</table>
								</div>

								<div class="panel-footer">
									<div id="pagerole">
										<nav aria-label="Page navigation">
									<ul class="pagination">
										<li id="losingingpagevalue" style="display: none"></li>
									    <li id="losingingpagecount" style="display: none"></li>
									    <li><a href="#" id="losingfirst">首页</a></li>
									    <li><a href="#" id="losingprev">上一页</a></li>
									    <li><a href="#" id="losingnext">下一页</a></li>
									    <li><a href="#" id="losinglast">尾页</a></li>
									</ul>
								</nav>
									</div>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>

		</div>
		<div class="footer">
			<div>
				<strong>Copyright</strong>版权所有 &copy; 2017
			</div>
		</div>

		</div>
		</div>
		
<div>
	<div class="modal fade" id="modeladd" tabindex="-1" role="dialog">
		<div class="modal-dialog">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal"
						aria-label="Close">
						<span aria-hidden="true">&times;</span>
					</button>
					<h4 class="modal-title">物品详情</h4>
				</div>
				<div class="modal-body">
					<div class="form-group">
						<!--
                                	作者：1462859532@qq.com
                                	时间：2017-03-28
                                	描述：可以在上面做个表单验证
                                -->
						<label for="locname" class="control-label">物品名称</label> <input
							type="text" name="" id="itemsDescription" class="form-control" value=""
							required="required" pattern="" title="">
					</div>
					<div class="form-group">
						<label for="area" class="control-label">用户姓名</label> <input
							type="text" class="form-control" id="userName" placeholder="地区">
					</div>
					<div class="form-group">
						<label for="phone" class="control-label">联系方式</label> <input
							type="text" class="form-control" id="phone" placeholder="联系电话">
					</div>
					<div class="form-group">
						<label for="phone" class="control-label">丢失时间</label> <input
							type="text" class="form-control" id="losingTime" placeholder="联系电话">
					</div>
					<div class="form-group">
						<!--
                                	作者：1462859532@qq.com
                                	时间：2017-03-28
                                	描述：可以在上面做个表单验证
                                -->
						<label for="locname" class="control-label">图片</label> 
						<img id="imgpic" style="width:500px;height:300px"/>
					</div>
					<div class="form-group">
						<!--
                                	作者：1462859532@qq.com
                                	时间：2017-03-28
                                	描述：可以在上面做个表单验证
                                -->
						<label for="locname" class="control-label" id="detaildescritton">详情:</label> 
						
					</div>
				</div>
				<div class="modal-footer">
                    <button type="button" class="btn btn-danger" id="cancellose"
						data-dismiss="modal">拒绝</button>
					<button type="button" class="btn btn-default" id="addclose"
						data-dismiss="modal">关闭</button>
					<button type="button" class="btn btn-primary" id="sure"
						data-dismiss="modal">同意</button>
				</div>
			</div>
		</div>
	</div>
</div>		
				<!--模态框关闭-->

		<!-- Mainly scripts -->
		<script src="../js/jquery.js"></script>
		<script src="../js/bootstrap.min.js"></script>
		<script src="../js/jquery.metisMenu.js"></script>
		<script src="../js/jquery.slimscroll.min.js"></script>

		<!-- Custom and plugin javascript -->
		<script src="../js/inspinia.js"></script>
		<script src="../js/pace.min.js"></script>
		<script type="text/javascript" src="../js/sweetalert.min.js" ></script>
		<script>
			$(function(){
				$.ajax({
		    		 type:"post",
		    		 url:"../user/allcategory.action",
		    		 dataType:"json",
		    		 success:function(data){
		    			 for(var i=0;i<data.length;i++){
		    				 $("#categotyappend").append("<option value="+data[i].categoryID+">"+data[i].categoryName+"</option>");
		    			 }
		    			
		    		 }
		    	 });
				
				$.ajax({
					type:"post",
					url:"../admin/queryunlosing.action?checkdeal=0",
					dataType:"json",
					success:function(data){
						if(data.losinginfo.length>=5){
		    				  length=5;
		    			  }else{
		    				  length=data.losinginfo.length;
		    			  }
		    			  for(var i=0;i<length;i++){
		    				  if(data.losinginfo[i].itemlocation==null){
		    					  data.losinginfo[i].itemlocation="无";
		    				  }
		    				  if(data.losinginfo[i].itemsDescription==null){
		    					  data.losinginfo[i].itemsDescription="无";
		    				  }
		    				  $("#losingitem").append('<tr><td style="display: none;">'+
		    						  data.losinginfo[i].losingId+'</td><td>'+
		    						  data.losinginfo[i].categoryName+'</td><td>'+
		    						  data.losinginfo[i].itemlocation+'</td><td>'+
		    						  data.losinginfo[i].losingTime+'</td><td>'+
		    						  data.losinginfo[i].itemsDescription+'</td><td><button class="btn btn-primary agree" onclick="agree(this)">查看</button>'+
		    						  '<button class="btn btn-success cancel" onclick="refuse(this)">删除</button></td></tr>');
		    				  $("#losingingpagevalue").text(data.currentpage);
		    			  }
		    			  $("#losingingpagecount").text(data.count);
					}
				});
				
				 $("#losingfirst").click(function(){
		    		 var categotyappend=$("#categotyappend").find("option:selected").val();
		    		 var isdeal=$("#isdeal").find("option:selected").val();
		    		 var itemsDescription=$("#querybydesc").val();
		    		  $.ajax({
	    				  type:"post",
			    		  url:"../admin/queryunlosing.action?currentpage=0",
			    		  dataType:"json",
			    		  data:{"categoryID":categotyappend,"checkdeal":isdeal,"itemsDescription":itemsDescription},
			    		  success:function(data){
			    			  $("#losingitem tr").remove();
			    			  if(data.losinginfo.length>=5){
			    				  length=5;
			    			  }else{
			    				  length=data.losinginfo.length;
			    			  }
			    			  for(var i=0;i<length;i++){
			    				  if(data.losinginfo[i].itemlocation==null){
			    					  data.losinginfo[i].itemlocation="无";
			    				  }
			    				  if(data.losinginfo[i].itemsDescription==null){
			    					  data.losinginfo[i].itemsDescription="无";
			    				  }
			    				  $("#losingitem").append('<tr><td style="display: none;">'+
			    						  data.losinginfo[i].losingId+'</td><td>'+
			    						  data.losinginfo[i].categoryName+'</td><td>'+
			    						  data.losinginfo[i].itemlocation+'</td><td>'+
			    						  data.losinginfo[i].losingTime+'</td><td>'+
			    						  data.losinginfo[i].itemsDescription+'</td><td><button class="btn btn-primary agree" onclick="agree(this)">删除</button>'+
			    						  '<button class="btn btn-success cancel" onclick="refuse(this)">查看</button></td></tr>');
			    				  $("#losingingpagevalue").text(data.currentpage);
			    			  }
			    			  $("#losingingpagecount").text(data.count);
			    		  }
	    			  })
		    	  });
		    	  //上一页
		    	  $("#losingprev").click(function(){
		    		  var itemsDescription=$("#querybydesc").val();
		    		  var isdeal=$("#isdeal").find("option:selected").val();
		    		  var categotyappend=$("#categotyappend").find("option:selected").val();
		    		  //alert(123);
		    		  //当前页
		    		  var pagecurrent=$("#losingingpagevalue").text();
		    		  //总页数
		    		  var pagecount=$("#losingingpagecount").text();
		    		  if(pagecurrent==0){
		    			  alert("不好意思，已经是第一页了");
		    		  }
		    		  else{
		    			  $.ajax({
		    				  type:"post",
				    		  url:"../admin/queryunlosing.action?currentpage="+(parseInt(pagecurrent)-1),
				    		  dataType:"json",
				    		  data:{"categoryID":categotyappend,"checkdeal":isdeal,"itemsDescription":itemsDescription},
				    		  success:function(data){
				    			  $("#losingitem tr").remove();
				    			  if(data.losinginfo.length>=5){
				    				  length=5;
				    			  }else{
				    				  length=data.losinginfo.length;
				    			  }
				    			  for(var i=0;i<length;i++){
				    				  if(data.losinginfo[i].itemlocation==null){
				    					  data.losinginfo[i].itemlocation="无";
				    				  }
				    				  if(data.losinginfo[i].itemsDescription==null){
				    					  data.losinginfo[i].itemsDescription="无";
				    				  }
				    				  $("#losingitem").append('<tr><td style="display: none;">'+
				    						  data.losinginfo[i].losingId+'</td><td>'+
				    						  data.losinginfo[i].categoryName+'</td><td>'+
				    						  data.losinginfo[i].itemlocation+'</td><td>'+
				    						  data.losinginfo[i].losingTime+'</td><td>'+
				    						  data.losinginfo[i].itemsDescription+'</td><td><button class="btn btn-primary agree" onclick="agree(this)">查看</button>'+
				    						  '<button class="btn btn-success cancel" onclick="refuse(this)">删除</button></td></tr>');
				    				  $("#losingingpagevalue").text(data.currentpage);
				    			  }
				    			  $("#losingingpagecount").text(data.count);
				    		  }
		    			  })
		    		  }
		    		 // 
		    	  });
		    	  //下一页
		    	  $("#losingnext").click(function(){
		    		  var isdeal=$("#isdeal").find("option:selected").val();
		    		  var categotyappend=$("#categotyappend").find("option:selected").val();
		    		  var itemsDescription=$("#querybydesc").val();
		    		  //当前页
		    		  var pagecurrent=$("#losingingpagevalue").text();
		    		  //总页数
		    		  var pagecount=$("#losingingpagecount").text();
		    		  if((parseInt(pagecurrent)+1)*5>=pagecount){
		    			  alert("不好意思，已经是最后一页了");
		    		  }else{
		    			  $.ajax({
		    				  type:"post",
				    		  url:"../admin/queryunlosing.action?currentpage="+(parseInt(pagecurrent)+1),
				    		  dataType:"json",
				    		  data:{"categoryID":categotyappend,"checkdeal":isdeal,"itemsDescription":itemsDescription},
				    		  success:function(data){
				    			  $("#losingitem tr").remove();
				    			  if(data.losinginfo.length>=5){
				    				  length=5;
				    			  }else{
				    				  length=data.losinginfo.length;
				    			  }
				    			  for(var i=0;i<length;i++){
				    				  if(data.losinginfo[i].itemlocation==null){
				    					  data.losinginfo[i].itemlocation="无";
				    				  }
				    				  if(data.losinginfo[i].itemsDescription==null){
				    					  data.losinginfo[i].itemsDescription="无";
				    				  }
				    				  $("#losingitem").append('<tr><td style="display: none;">'+
				    						  data.losinginfo[i].losingId+'</td><td>'+
				    						  data.losinginfo[i].categoryName+'</td><td>'+
				    						  data.losinginfo[i].itemlocation+'</td><td>'+
				    						  data.losinginfo[i].losingTime+'</td><td>'+
				    						  data.losinginfo[i].itemsDescription+'</td><td><button class="btn btn-primary agree" onclick="agree(this)">查看</button>'+
				    						  '<button class="btn btn-success cancel" onclick="refuse(this)">删除</button></td></tr>');
				    				  
				    				  $("#losingingpagevalue").text(data.currentpage);
				    			  }
				    			  $("#losingingpagecount").text(data.count);
				    		  }
		    			  })

		    		  }
		    	  });
		    	  //最后一页
		    	  $("#losinglast").click(function(){
		    		  var itemsDescription=$("#querybydesc").val();
		    		  var isdeal=$("#isdeal").find("option:selected").val();
		    		  var categotyappend=$("#categotyappend").find("option:selected").val();
		    		  var last;
		    		  if(parseInt($("#losingingpagecount").text())%5!=0){
		    			  last=parseInt(parseInt($("#losingingpagecount").text())/5);
		    		  }else{
		    			  last=parseInt($("#losingingpagecount").text())/5-1;
		    		  }
		    		  $.ajax({
	    				  type:"post",
			    		  url:"../admin/queryunlosing.action?currentpage="+last,
			    		  data:{"categoryID":categotyappend,"checkdeal":isdeal,"itemsDescription":itemsDescription},
			    		  dataType:"json",
			    		  success:function(data){
			    			  $("#losingitem tr").remove();
			    			  if(data.losinginfo.length>=5){
			    				  length=5;
			    			  }else{
			    				  length=data.losinginfo.length;
			    			  }
			    			  for(var i=0;i<length;i++){
			    				  if(data.losinginfo[i].itemlocation==null){
			    					  data.losinginfo[i].itemlocation="无";
			    				  }
			    				  if(data.losinginfo[i].itemsDescription==null){
			    					  data.losinginfo[i].itemsDescription="无";
			    				  }
			    				  $("#losingitem").append('<tr><td style="display: none;">'+
			    						  data.losinginfo[i].losingId+'</td><td>'+
			    						  data.losinginfo[i].categoryName+'</td><td>'+
			    						  data.losinginfo[i].itemlocation+'</td><td>'+
			    						  data.losinginfo[i].losingTime+'</td><td>'+
			    						  data.losinginfo[i].itemsDescription+'</td><td><button class="btn btn-primary agree" onclick="agree(this)">查看</button>'+
			    						  '<button class="btn btn-success cancel" onclick="refuse(this)">删除</button></td></tr>');
			    				  $("#losingingpagevalue").text(data.currentpage);
			    			  }
			    			  $("#losingingpagecount").text(data.count);
			    		  }
	    			  })
		    	  });
			})
				
			$("#categotyappend").change(function(){
				        var itemsDescription=$("#querybydesc").val();
				    	var categotyappend=$("#categotyappend").find("option:selected").val();
				    	var isdeal=$("#isdeal").find("option:selected").val();
				    	$.ajax({
				    		  type:"post",
				    		  url:"../admin/queryunlosing.action",
				    		  data:{"categoryID":categotyappend,"checkdeal":isdeal,"itemsDescription":itemsDescription},
				    		  dataType:"json",
				    		  success:function(data){
				    			  $("#losingitem tr").remove();
				    			  if(data.losinginfo.length>=5){
				    				  length=5;
				    			  }else{
				    				  length=data.losinginfo.length;
				    			  }
				    			  for(var i=0;i<length;i++){
				    				  if(data.losinginfo[i].itemlocation==null){
				    					  data.losinginfo[i].itemlocation="无";
				    				  }
				    				  if(data.losinginfo[i].itemsDescription==null){
				    					  data.losinginfo[i].itemsDescription="无";
				    				  }
				    				  $("#losingitem").append('<tr><td style="display: none;">'+
				    						  data.losinginfo[i].losingId+'</td><td>'+
				    						  data.losinginfo[i].categoryName+'</td><td>'+
				    						  data.losinginfo[i].itemlocation+'</td><td>'+
				    						  data.losinginfo[i].losingTime+'</td><td>'+
				    						  data.losinginfo[i].itemsDescription+'</td><td><button class="btn btn-primary agree" onclick="agree(this)">查看</button>'+
				    						  '<button class="btn btn-success cancel" onclick="refuse(this)">删除</button></td></tr>');
				    				  $("#losingingpagevalue").text(data.currentpage);
				    			  }
				    			  $("#losingingpagecount").text(data.count);
				    		  }
				    	  });
				    });
			$("#isdeal").change(function(){
				var itemsDescription=$("#querybydesc").val();
		    	var isdeal=$("#isdeal").find("option:selected").val();
		    	var categotyappend=$("#categotyappend").find("option:selected").val();
		    	$.ajax({
		    		  type:"post",
		    		  url:"../admin/queryunlosing.action",
		    		  data:{"categoryID":categotyappend,"checkdeal":isdeal,"itemsDescription":itemsDescription},
		    		  dataType:"json",
		    		  success:function(data){
		    			  $("#losingitem tr").remove();
		    			  if(data.losinginfo.length>=5){
		    				  length=5;
		    			  }else{
		    				  length=data.losinginfo.length;
		    			  }
		    			  for(var i=0;i<length;i++){
		    				  if(data.losinginfo[i].itemlocation==null){
		    					  data.losinginfo[i].itemlocation="无";
		    				  }
		    				  if(data.losinginfo[i].itemsDescription==null){
		    					  data.losinginfo[i].itemsDescription="无";
		    				  }
		    				  $("#losingitem").append('<tr><td style="display: none;">'+
		    						  data.losinginfo[i].losingId+'</td><td>'+
		    						  data.losinginfo[i].categoryName+'</td><td>'+
		    						  data.losinginfo[i].itemlocation+'</td><td>'+
		    						  data.losinginfo[i].losingTime+'</td><td>'+
		    						  data.losinginfo[i].itemsDescription+'</td><td><button class="btn btn-primary agree" onclick="agree(this)">查看</button>'+
		    						  '<button class="btn btn-success cancel" onclick="refuse(this)">删除</button></td></tr>');
		    				  $("#losingingpagevalue").text(data.currentpage);
		    			  }
		    			  $("#losingingpagecount").text(data.count);
		    		  }
		    	  });
		    });
			
			$("#query").click(function(){
				var itemsDescription=$("#querybydesc").val();
		    	var categotyappend=$("#categotyappend").find("option:selected").val();
		    	var isdeal=$("#isdeal").find("option:selected").val();
		    	 $.ajax({
   				  type:"post",
		    		  url:"../admin/queryunlosing.action",
		    		  dataType:"json",
		    		  data:{"categoryID":categotyappend,"checkdeal":isdeal,"itemsDescription":itemsDescription},
		    		  success:function(data){
		    			  $("#losingitem tr").remove();
		    			  if(data.losinginfo.length>=5){
		    				  length=5;
		    			  }else{
		    				  length=data.losinginfo.length;
		    			  }
		    			  for(var i=0;i<length;i++){
		    				  if(data.losinginfo[i].itemlocation==null){
		    					  data.losinginfo[i].itemlocation="无";
		    				  }
		    				  if(data.losinginfo[i].itemsDescription==null){
		    					  data.losinginfo[i].itemsDescription="无";
		    				  }
		    				  $("#losingitem").append('<tr><td style="display: none;">'+
		    						  data.losinginfo[i].losingId+'</td><td>'+
		    						  data.losinginfo[i].categoryName+'</td><td>'+
		    						  data.losinginfo[i].itemlocation+'</td><td>'+
		    						  data.losinginfo[i].losingTime+'</td><td>'+
		    						  data.losinginfo[i].itemsDescription+'</td><td><button class="btn btn-primary agree" onclick="agree(this)">查看</button>'+
		    						  '<button class="btn btn-success cancel" onclick="refuse(this)">删除</button></td></tr>');
		    				  $("#losingingpagevalue").text(data.currentpage);
		    			  }
		    			  $("#losingingpagecount").text(data.count);
		    		  }
   			  })
		    	
			})
			var tempid;
			function agree(e){
				 var id=$(e).parent().parent().children(":first").text();
				 var isdeal=$("#isdeal").find("option:selected").val();
				 if(isdeal==1||isdeal==2){
					$("#sure").hide();
					$("#cancellose").hide();
				 }
				 tempid=id;
				 $("#modeladd").modal("show");	
				 $("#detaildescritton").text("");
				 $.ajax({
					 type:"post",
					 url:"../user/losdetail.action?picid="+id,
					 dataType:"json",
					 success:function(data){
						 $("#itemsDescription").val(data.itemsDescription);
						 $("#userName").val(data.userName);
						 $("#phone").val(data.phone);
						 $("#losingTime").val(data.losingTime);
						 $("#imgpic").attr("src","/pic/"+data.picture);
						 $("#detaildescritton").append(data.detaildescritton);
			
					 }
				 })
				 
			}
			
			$("#sure").click(function(){
				 $.ajax({
					 type:"post",
					 url:"../admin/updatelosedeal.action",
					 dataType:"json",
					 data:{"losingId":tempid,"checkdeal":1},
					 success:function(data){
						 if(data==1){
							 swal("成功!", "此操作已被处理", "success")
							 $(e).parent().parent().remove();
						 }else{
							 swal("取消", "操作未成功 :)", "error");
						 }
						
					 }
				 })
			})
			$("#cancellose").click(function(){
				$.ajax({
					 type:"post",
					 url:"../admin/updatelosedeal.action",
					 dataType:"json",
					 data:{"losingId":tempid,"checkdeal":2},
					 success:function(data){
						 if(data==1){
							 swal("成功!", "此操作已被处理", "success")
							 $(e).parent().parent().remove();
						 }else{
							 swal("取消", "操作未成功 :)", "error");
						 }
						
					 }
				 })
			})
				 
			
			function refuse(e){
				 var id=$(e).parent().parent().children(":first").text();
				 $.ajax({
					 type:"post",
					 url:"../admin/deletelose.action?id="+id,
					 dataType:"json",			 
					 success:function(data){
						 if(data==1){
							 swal("成功!", "此操作已被拒绝", "success")
							 $(e).parent().parent().remove();
						 }else{
							 swal("取消", "操作未成功 :)", "error");
						 }			
					 }
				 })
			}
			
		</script>
	</body>

</html>